/*
										
										//旋转
											org.opencv.core.Point center =new org.opencv.core.Point(rgbMat.width()/2,rgbMat.height()/2);
											Mat affineTrans=Imgproc.getRotationMatrix2D(center, 90.0, 1.0);
											Imgproc.warpAffine(rgbMat, rgbMat, affineTrans, rgbMat.size(),Imgproc.INTER_NEAREST);
											Imgcodecs.imwrite("/sdcard/Yrotate.jpg", rgbMat);
											
										//镜像
											Core.flip(rgbMat, rgbMat, 1);//镜像
											Imgcodecs.imwrite("/sdcard/Yrotate.jpg", rgbMat);
*/

//加载资源图片
        srcBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.aa);

		grayBitmap = Bitmap.createBitmap(srcBitmap.getWidth(), srcBitmap.getHeight(), Bitmap.Config.RGB_565);

		Utils.bitmapToMat(srcBitmap, rgbMat);//将原始位图转换为Mat，R G B。

Imgproc.cvtColor(srcImgMat, newImgMat, Imgproc.COLOR_RGB2GRAY);//rgbMat to gray grayMat
		
Imgcodecs.imwrite("/sdcard/huidu.jpg", newImgMat);
	
	